Skip to content

Conversation

@AlexPapadakis
Copy link
Contributor

@AlexPapadakis AlexPapadakis commented Oct 14, 2025

Fixes #

Proposed Changes

-added contracts module
-with fallback to asserts when contracts are not supported
-and option to enchance asserts with contract asserts

Any background context you want to provide?

more on the GSoC report here:
https://alexpapadakis.github.io/hpx_contracts/

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

@StellarBot
Copy link

Can one of the admins verify this patch?

@AlexPapadakis AlexPapadakis changed the title Contract test contracts module Oct 14, 2025
@hkaiser
Copy link
Member

hkaiser commented Oct 16, 2025

@AlexPapadakis could you please take care of the clang-format, cmake-format, and inspect errors reported?

@AlexPapadakis
Copy link
Contributor Author

AlexPapadakis commented Oct 16, 2025

@hkaiser yes absolutely, I will spend time on it in the Weekend

Copy link
Contributor

@isidorostsa isidorostsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, a couple of nitpicks and we should be able to merge

@codacy-production
Copy link

codacy-production bot commented Oct 17, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.97% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (cf950cf) 273084 235163 86.11%
Head commit (88088e2) 194978 (-78106) 166004 (-69159) 85.14% (-0.97%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6789) 3 3 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@hkaiser hkaiser force-pushed the contract_test branch 2 times, most recently from 487994b to 0040396 Compare November 12, 2025 20:45
@hkaiser hkaiser added this to the 2.0.0 milestone Nov 12, 2025
AlexPapadakis and others added 2 commits December 1, 2025 08:31
- updated cmake option for enchanced asserts to follow convention
- updated fallback logic, added config test for experimental builds
- improved documentation
- added config test to automatically run the appropriate tests for either native or fallback mode
- contracts: Restructure test suite for clarity and completeness
- Add comprehensive declaration-based contract failure tests:
  * declaration_contracts_fail_pre.cpp
  * declaration_contracts_fail_post.cpp
  * declaration_contracts_fail_contract_assert.cpp
- Remove redundant test files (contract_fail.cpp, simple_contracts_*)
- Update CMakeLists.txt with proper test organization:
  * Declaration tests: C++26 syntax (__cpp_contracts mode)
  * Fallback tests: Simple syntax (fallback mode)
  * Disabled tests: No-op behavior testing
- Set appropriate WILL_FAIL properties for all failure tests
- Test structure now clearly separates native C++26 contract testing from HPX_ASSERT fallback behavior testing, providing comprehensive coverage of all contract modes.
- added contracts in core
@hkaiser hkaiser force-pushed the contract_test branch 2 times, most recently from 983587c to 0e1789e Compare December 1, 2025 14:50
- fixing remaining CI failures

Signed-off-by: Hartmut Kaiser <[email protected]>
@hkaiser hkaiser merged commit a2aee50 into STEllAR-GROUP:master Dec 1, 2025
69 of 73 checks passed
@hkaiser
Copy link
Member

hkaiser commented Dec 1, 2025

@AlexPapadakis thank you for working on this! Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants